package com.tsingteng.cosfun.ui.message.addplay;

import com.tsingteng.cosfun.bean.UserBean;
import com.tsingteng.cosfun.callback.RxObserver;
import com.tsingteng.cosfun.mvp.presenter.BasePresenter;
import com.tsingteng.cosfun.ui.message.geneal.model.PlayModel;

/***
 * 写便当P层
 * 常胜；
 * 2018.8.11
 * */
public class WritingPresenter extends BasePresenter<WritingPlayContract.IWritingView> implements WritingPlayContract.IWritingPresenter {
    private WritingPlayContract.IWritingView mView;
    private PlayModel model;

    public WritingPresenter() {
        model = new PlayModel();
    }

    @Override
    public void savePlay() {

    }

    @Override
    public void pulishPlay(String content) {
        mView = getView();
        RxObserver<String> rxObserver = new RxObserver<String>(this) {
            @Override
            protected void onFaile(int errorCode, String errorMsg) {
                mView.showFail(errorMsg);
            }

            @Override
            protected void onSuccess(String status) {
                mView.showResult(status);
            }
        };
        model.getAddPlay(content,rxObserver);
        addDisposable(rxObserver);
    }
}
